package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbTrainingExperienceRef;
import rpd.model.TbTrainingExperienceRefExample;
import rpd.model.TbTrainingExperienceRefKey;

public interface TbTrainingExperienceRefMapper {
    long countByExample(TbTrainingExperienceRefExample example);

    int deleteByExample(TbTrainingExperienceRefExample example);

    @Delete({
        "delete from tb_training_experience_ref",
        "where id = #{id,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbTrainingExperienceRefKey key);

    @Insert({
        "insert into tb_training_experience_ref (id, address, org_name, ",
        "content, time, card, ",
        "card_path, resume_id)",
        "values (#{id,jdbcType=CHAR}, #{address,jdbcType=CHAR}, #{orgName,jdbcType=CHAR}, ",
        "#{content,jdbcType=CHAR}, #{time,jdbcType=DATE}, #{card,jdbcType=CHAR}, ",
        "#{cardPath,jdbcType=CHAR}, #{resumeId,jdbcType=CHAR})"
    })
    int insert(TbTrainingExperienceRef record);

    int insertSelective(TbTrainingExperienceRef record);

    List<TbTrainingExperienceRef> selectByExample(TbTrainingExperienceRefExample example);

    @Select({
        "select",
        "id, address, org_name, content, time, card, card_path, resume_id",
        "from tb_training_experience_ref",
        "where id = #{id,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbTrainingExperienceRefMapper.BaseResultMap")
    TbTrainingExperienceRef selectByPrimaryKey(TbTrainingExperienceRefKey key);

    int updateByExampleSelective(@Param("record") TbTrainingExperienceRef record, @Param("example") TbTrainingExperienceRefExample example);

    int updateByExample(@Param("record") TbTrainingExperienceRef record, @Param("example") TbTrainingExperienceRefExample example);

    int updateByPrimaryKeySelective(TbTrainingExperienceRef record);

    @Update({
        "update tb_training_experience_ref",
        "set address = #{address,jdbcType=CHAR},",
          "org_name = #{orgName,jdbcType=CHAR},",
          "content = #{content,jdbcType=CHAR},",
          "time = #{time,jdbcType=DATE},",
          "card = #{card,jdbcType=CHAR},",
          "card_path = #{cardPath,jdbcType=CHAR},",
          "resume_id = #{resumeId,jdbcType=CHAR}",
        "where id = #{id,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbTrainingExperienceRef record);
}